package com.sinosoft.emplmis.collect.service;

import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;

import com.sinosoft.emplmis.collect.entity.LaborCollectEntity;
import com.sinosoft.emplmis.collect.manager.LaborCollectManager;

public class LaborCollectService {

	private LaborCollectManager laborCollectManager;

	public LaborCollectManager getLaborCollectManager() {
		return laborCollectManager;
	}

	public void setLaborCollectManager(LaborCollectManager laborCollectManager) {
		this.laborCollectManager = laborCollectManager;
	}
	
	/**
	 * 获取劳动力汇总信息（全区）
	 * @return
	 */
	public List<LaborCollectEntity> getLaborCollectList(){
	    Logger.getRootLogger().info("获取全区劳动力汇总信息");
	    List<LaborCollectEntity> laborCollectList = new ArrayList<LaborCollectEntity> ();
	    laborCollectList = laborCollectManager.getLaborCollectList();
	    laborCollectList.add(laborCollectManager.getLaborCollectTotal().get(0));
		return laborCollectList;		
	}
	
	/**
	 * 获取劳动力汇总信息（街道）
	 * @return
	 */
	public List<LaborCollectEntity> getLaborStreetList(String streetName,String streetId){
		Logger.getRootLogger().info("获取街道劳动力汇总信息");
		List<LaborCollectEntity> laborStreetList = new ArrayList<LaborCollectEntity> ();
		laborStreetList = laborCollectManager.getLaborStreetList(streetName,streetId);	
		laborStreetList.add(laborCollectManager.getLaborStreetTotal(streetName,streetId).get(0));
		return laborStreetList;
	}
	
	/**
	 * 获取劳动力汇总信息（社区）
	 * @return
	 */
	public List<LaborCollectEntity> getLaborCommunityList(String communityName){
		Logger.getRootLogger().info("获取社区劳动力汇总信息");
		return laborCollectManager.getLaborCommunityList(communityName);
	}
		
}
